#include <vector>
using namespace std;

class Solution
{
public:
    static vector<int> twoSum(vector<int>& price, int target)
    {
        int left = 0;
        int right = price.size()-1;

        while(left < right)
        {
            if(price[left] + price[right] == target)
            {
                return {price[left], price[right]};
            }
            else if(price[left] + price[right] > target)
            {
                right--;
            }
            else
            {
                left++;
            }
        }
        return {-1, -1};
    }
};
